/**
 * 
 */
package com.scholarone.s1exporttool.service;

import java.io.InputStream;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.scholarone.s1exporttool.common.DataSource;
import com.scholarone.s1exporttool.common.DataSourceContextHolder;
import com.scholarone.s1exporttool.dao.ExportDao;
import com.scholarone.s1exporttool.domain.Resource;

/**
 * @author prabz
 *
 */
@Service("exportService")
public class ExportServiceImpl implements ExportService {

	@Autowired
	private ExportDao exportDao;
	
	@Override
	public List<Resource> getResources() {
		// TODO Auto-generated method stub
		return exportDao.getResources();
	}

	@Override
	public Boolean importXML(int dataSourceId, InputStream fis) throws Exception{
		// TODO Auto-generated method stub
		// Set the Datasource
		DataSourceContextHolder.setDataSource(DataSource.get(dataSourceId));
		// Process the xml file using the input stream
		return true;
	}
	
}
